module.exports = function ($scope, $resource, $modal, toaster) {
	

    $scope.currentPage = 1;      //当前页码
	$scope.itemsPerPage = 10         //每页显示几条
	$scope.searchform = {};

    $scope.search = function(pageNo){
		var para = {
			'pageNo': pageNo,
			'pageSize': $scope.itemsPerPage,
			'nickname': $scope.searchform.nickname
		}
		$resource('/api/as/mc/shophelp/getAnswerList', {}, {}).save(para, function (res) {
			if (res.errcode === 0) {
				$scope.objs = res.data.results;
				$scope.totalItems = res.data.totalRecord;
			} else {
				toaster.error({title: '', body: '无统计数据'});
			}
		});
	}
	$scope.search(1);
	
	$scope.answerInfo = function(obj){
		var modalInstance = $modal.open({
        	template: require('../views/answerInfo.html'),
        	controller: 'answerInfo',
        	size: 'lg',
        	resolve: {
				item: function () {
					return obj;
				}
        	}
        });
        modalInstance.result.then(function(result){	
            
        });
	}
    

};